﻿function TopAd() {
    var strTopAd = "";

    //定义图片或flash内容
    //strTopAd = "<div id=adimage style=\"display:none\">";
    strTopAd = "<div id=adimage style=\"display:none;width:" + fileWidth + "\" align=\"center\">";

    //strTopAd += "<div style=\"position:absolute;z-index:100;width:" + fileWidth + "px\" align=\"right\">";
    strTopAd += "<div style=\"position:absolute;z-index:1001;width:" + fileWidth + "px\" align=\"right\">";
    strTopAd += "<img src=\"/Content/images/del.gif\" border=\"0\" style=\"cursor: pointer\" onclick=\"upImg();\" />";
    strTopAd += "</div>";

    //strTopAd += "<div id=adBig>";

    if (zt == 1) //图片
    {
        strTopAd += "<a href=\"" + hrefsrc + "\"";
        if (hrefsrc != "javascript:;") {
            strTopAd += " target=\"_self\"";
        }
        strTopAd += ">";
        strTopAd += "<img src=\"" + fileSrc + "\" width=\"" + fileWidth + "\" height=\"" + fileHeight + "\" border=0/></a>";
    }
    else if (zt == 2)//flash
    {
        strTopAd += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + fileWidth + '"height="' + fileHeight + '">';
        strTopAd += '<param name="movie" value="' + fileSrc + '" />';
        strTopAd += '<param name="quality" value="high" />';
        strTopAd += '<embed src="' + fileSrc + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + fileWidth + '"height="' + fileHeight + '"></embed>';
        strTopAd += '</object>';
    }
    // strTopAd += "</div>";

    strTopAd += "</div>";

    return strTopAd;
}

document.write(TopAd());

$(function() {
    //过1秒显示 showImage(); 内容
    setTimeout("showImage();", 1000);
    //过6秒后隐藏内容
    setTimeout("upImg();", 6000);
});

function showImage()//显示层
{
    //$("#adBig").slideUp(1000);
    $("#adimage").slideDown(1000);
}


function upImg() //隐藏层
{
    $("#adimage").slideUp(1000);
}